import request from '/@/utils/request';

const module = '/eva'

const path = module + '/tasks';

// 查询量问题列表
export function list(query: object) {
  return request({
    url:  path + '/',
    method: 'get',
    params: query
  })
}

// 查询量问题详细
export function getObj(id: string) {
  return request({
    url: path + '/' + id,
    method: 'get'
  })
}

// 新增量问题
export function addObj(data: object) {
  return request({
    url: path ,
    method: 'post',
    data: data
  })
}

// 修改量问题
export function putObj(data: object) {
  return request({
    url: path,
    method: 'put',
    data: data
  })
}

// 删除量问题
export function delObj(id: string) {
  return request({
    url: path + id,
    method: 'delete'
  })
}

// 答题内容
export function answers(planId: string, scaleId: string) {
  return request({
    url: path + '/' + planId + '/scales/' + scaleId,
    method: 'get'
  })
}

// 提交答案
export function submitAnswer(planId: string, scaleId: string, data: object) {
  return request({
    url: path + '/' + planId + '/scales/' + scaleId,
    method: 'post',
    data: data
  })
}


